<?php
declare(strict_types=1);
/**
 * @project=>兔兔找图微信小程序
 * @author=>kert
 * @date=>2023/5/22
 * @link=>http://www.tiku-cloud.com/
 * @site=>微信搜索-兔兔找图
 */

namespace App\Library\Ai\FlagStudio;

class FlagStudioImage extends ApiBase
{
    public function textToImage(array $params)
    {
        $requestParams = [
            "prompt" => "奔腾的骏马",
            "guidance_scale" => 7.5,
            "height" => 512,
            "negative_prompts" => "森林 城市",
            "sampler" => "ddim",
            "seed" => 1024,
            "steps" => 50,
            "style" => "国画",
            "upsample" => 1,
            "width" => 512
        ];

        var_dump($this->requestPost("https://flagopen.baai.ac.cn/flagStudio/v1/text2img", $requestParams));
    }
}
